package com.xucy.springboot.designmodel.structural.facede;

/**
 * @Author xucy
 * @Date 2019-07-17 20:49
 * @Description
 **/

public class GiftExchange {

    private GiftNumber giftNumber=new GiftNumber();
    private GiftPointBuy giftPointBuy=new GiftPointBuy();
    private GiftPointCheck giftPointCheck=new GiftPointCheck();
    /**
     * 外观类的方法，兑换礼物
     *
     * @Author xucy
     * @Date 20:49 2019-07-17
     * @param
     * @return
     */
    public void exchange(Gift gift){
        if(giftPointCheck.checkPoint(gift)){
            if(giftPointBuy.buySuccess(gift)){
                String number=giftNumber.getGiftNumber(gift);
                System.out.println("订单号为："+number);
            }
        }
    }
}
